import { ListBaseQuery } from '../../common';
import { PlaceOrder } from '../../post-order';

export enum OrderStatus {
  posted = '0',
  receiving = '1',
  dispatching = '2'
}

export enum OrderPaymentStatus {
  wait = '0',
  done = '1'
}

export const OrderPaymentStatusInfo = {
  [OrderPaymentStatus.wait]: '未结算',
  [OrderPaymentStatus.done]: '已结算'
};

export enum OrderPaymentType {
  cash = '0',
  monthly = '1',
  delivery = '3'
}

export enum OrderType {
  normal = '0',
  transfer = '1',
  return = '2'
}

export interface OrderData {
  id: string;
  paymentStatus: OrderPaymentStatus;
  paidAmount: string;
  status: OrderStatus;
  receivingOrderId: number;
  receivingOrderTime: string;
  dispatchCarId: number;
  receivingOrderName: string;
  dispatchCarName: null | string;
  dispatchCarTime: null | string;
  treasurerId: null | string;
  treasurerTime: null | string;
  treasurerName: null | string;
  deptId: null | string;
  wareDocMxVoList: WareDocMxVoList[];
  startPosition: null | string;
  endPosition: null | string;
  createTime: string;

  bdrmc: string;
  articleSum: string;
  priceSum: string;
  postId: string;
  postName: string;
}

interface WareDocMxVoList extends PlaceOrder {
  mxId: string;
}

export interface OrderListQuery extends ListBaseQuery {
  paymentStatus?: OrderPaymentStatus;
  status?: OrderStatus;
  bdtype?: OrderType;
  customName?: string;
  carId?: string;
}
